package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.ServiceObjectTypeBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.IServiceObjectTypeView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by XZY on 2017/11/30.
 *获取服务对象类型
 */
public class ServiceObjectTypePest {

    private IServiceObjectTypeView objectView;

    public ServiceObjectTypePest(IServiceObjectTypeView objectView) {
        this.objectView=objectView;
    }

    public void getServiceObjectTypeList(){
        Map<String,Object> map=new HashMap<>();
        map.put("sid", MyApplication.sid);
        new ApiManager().getServiceObjectTypeList(map, new BaseCallBack<BaseResult<List<ServiceObjectTypeBean>>>() {
            @Override
            public void onSuccess(BaseResult<List<ServiceObjectTypeBean>> response) {
                objectView.getServiceObjectTypeList(response.getData());
            }
            @Override
            public void onFailures(String message) {
                objectView.showError(message);
            }
        });
    }

}
